package com.lianbang.staff.adapter

import cn.ubest.mvvmcore.utils.ResourcesUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lianbang.staff.R
import com.lianbang.staff.bean.ShopListBean

/**
 * Created by maoqi on 2020/12/28.
 */
class ShopListAdapter : BaseQuickAdapter<ShopListBean, BaseViewHolder>(R.layout.item_shop_list) {
    override fun convert(helper: BaseViewHolder, item: ShopListBean) {
        helper.setText(R.id.tv_title, item.nickname)
            .setText(R.id.tv_tag, if (item.is_audited != 1) "资质详情(未通过)" else "资质详情")
            .setTextColor(
                R.id.tv_tag,
                ResourcesUtils.getColor(if (item.is_audited != 1) "#F74850" else "#BEC1C2")
            )
            .setText(R.id.tv_order, "${item.allNum}")
            .setText(R.id.tv_category, "${item.cateNum}")
            .setText(R.id.tv_specification, "${item.allProductNum}")
            .setText(R.id.tv_income, "${item.allPrice}")
    }

}